package com.demo.poc.demopoc.completion;


import com.intellij.codeInsight.completion.CompletionParameters;
import com.intellij.codeInsight.completion.CompletionProvider;
import com.intellij.codeInsight.completion.CompletionResultSet;
import com.intellij.codeInsight.lookup.LookupElementBuilder;
import com.intellij.util.ProcessingContext;
import org.jetbrains.annotations.NotNull;

public class VueCompletionProvider extends CompletionProvider<CompletionParameters> {
    @Override
    protected void addCompletions(@NotNull CompletionParameters parameters, @NotNull ProcessingContext context,
                                  @NotNull CompletionResultSet result) {
        // 检测当前文件是否为 Vue 文件
        if (parameters.getOriginalFile().getFileType().getName().equals("Vue")) {
            // 提供 HTML 标签补全
            result.addElement(LookupElementBuilder.create("div"));
            result.addElement(LookupElementBuilder.create("span"));
            result.addElement(LookupElementBuilder.create("template"));
        }
    }
}
